#include <cstring>

class Staff{
    public:
        Staff(string name, int age): name(name),age(age){
            mem=(char*)malloc(20);
            cout<<"name="<<name<<" age="<<age<<endl;
        }
        Staff(const Staff&staff){
            name=staff.name;
            age=staff.age;
            mem=(char*)malloc(20);
            memcpy(mem,staff.mem,20);
            cout<<"copy"<<endl;
        }
        ~Staff(){
            if(mem!=nullptr){
                free(mem);
                mem=nullptr;
            }
            cout<<"deleted!"<<endl;
        }
        string name;
        int age;
        char *mem=nullptr;
};
